import request from "@/utils/request";

// 获取用户视频列表
export const getUserVideosService = (params) => {
  // return request({
  //   url: "/media/listUserVideo",
  //   method: "get",
  //   params: {
  //     current: params.current,
  //     size: params.size,
  //     type: "video",
  //   },
  // });
  return request.get("/media/listUserVideo", {
    params: {
      current: params.current,
      size: params.size,
      type: "video",
    },
  });
};

// 上传视频
export const uploadVideoService = (formData) => {
  return request({
    url: "/media/upload",
    method: "post",
    data: formData,
    headers: {
      "Content-Type": "multipart/form-data",
    },
  });
};

// 删除视频
export const deleteVideoService = (id) => {
  // return request({
  //   url: `/media/${id}`,
  //   method: "delete",
  // });
  return request.delete(`/media/${id}`);
};

// 更新视频信息
export const updateVideoService = (data) => {
  // return request({
  //   url: "/media",
  //   method: "put",
  //   data,
  // });
  return request.put("/media", data);
};

// 用户点赞视频
export const likeVideoService = (data) => {
  // return request({
  //   url: "/user-like/like",
  //   method: "post",
  //   data,
  // });
  return request.post("/user-like/like", data);
};

// 用户取消点赞视频
export const unlikeVideoService = (data) => {
  // return request({
  //   url: "/user-like/Unlike",
  //   method: "post",
  //   data,
  // });
  return request.post("/user-like/Unlike", data);
};
